<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InfSimulatedConnection</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
<link rel="home" href="index.html" title="libinfinity-0.4 Reference Manual">
<link rel="up" href="ch02.html" title="Common libinfinity API">
<link rel="prev" href="InfXmppConnection.html" title="InfXmppConnection">
<link rel="next" href="InfDiscoveryAvahi.html" title="InfDiscoveryAvahi">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="InfXmppConnection.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libinfinity-0.4 Reference Manual</th>
<td><a accesskey="n" href="InfDiscoveryAvahi.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#InfSimulatedConnection.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#InfSimulatedConnection.description" class="shortcut">Description</a>
                   | 
                  <a href="#InfSimulatedConnection.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#InfSimulatedConnection.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
                   | 
                  <a href="#InfSimulatedConnection.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry" title="InfSimulatedConnection">
<a name="InfSimulatedConnection"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="InfSimulatedConnection.top_of_page"></a>InfSimulatedConnection</span></h2>
<p>InfSimulatedConnection — Simulated network connection</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1" title="Stability Level">
<a name="InfSimulatedConnection.stability-level"></a><h2>Stability Level</h2>
Unstable, unless otherwise indicated
</div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="InfSimulatedConnection.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;libinfinity/common/inf-simulated-connection.h&gt;

                    <a class="link" href="InfSimulatedConnection.html#InfSimulatedConnection-struct" title="InfSimulatedConnection">InfSimulatedConnection</a>;
                    <a class="link" href="InfSimulatedConnection.html#InfSimulatedConnectionClass" title="InfSimulatedConnectionClass">InfSimulatedConnectionClass</a>;
enum                <a class="link" href="InfSimulatedConnection.html#InfSimulatedConnectionMode" title="enum InfSimulatedConnectionMode">InfSimulatedConnectionMode</a>;
<a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="returnvalue">InfSimulatedConnection</span></a> * <a class="link" href="InfSimulatedConnection.html#inf-simulated-connection-new" title="inf_simulated_connection_new ()">inf_simulated_connection_new</a>   (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfSimulatedConnection.html#inf-simulated-connection-connect" title="inf_simulated_connection_connect ()">inf_simulated_connection_connect</a>    (<em class="parameter"><code><a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a> *connection</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a> *to</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfSimulatedConnection.html#inf-simulated-connection-set-mode" title="inf_simulated_connection_set_mode ()">inf_simulated_connection_set_mode</a>   (<em class="parameter"><code><a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a> *connection</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfSimulatedConnection.html#InfSimulatedConnectionMode" title="enum InfSimulatedConnectionMode"><span class="type">InfSimulatedConnectionMode</span></a> mode</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfSimulatedConnection.html#inf-simulated-connection-flush" title="inf_simulated_connection_flush ()">inf_simulated_connection_flush</a>      (<em class="parameter"><code><a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a> *connection</code></em>);
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="InfSimulatedConnection.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----InfSimulatedConnection
</pre>
</div>
<div class="refsect1" title="Implemented Interfaces">
<a name="InfSimulatedConnection.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
InfSimulatedConnection implements
 <a class="link" href="InfXmlConnection.html" title="InfXmlConnection">InfXmlConnection</a>.</p>
</div>
<div class="refsect1" title="Properties">
<a name="InfSimulatedConnection.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="InfSimulatedConnection.html#InfSimulatedConnection--mode" title='The "mode" property'>mode</a>"                     <a class="link" href="InfSimulatedConnection.html#InfSimulatedConnectionMode" title="enum InfSimulatedConnectionMode"><span class="type">InfSimulatedConnectionMode</span></a>  : Read / Write / Construct
  "<a class="link" href="InfSimulatedConnection.html#InfSimulatedConnection--target" title='The "target" property'>target</a>"                   <a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a>*  : Read / Write
</pre>
</div>
<div class="refsect1" title="Description">
<a name="InfSimulatedConnection.description"></a><h2>Description</h2>
<p>
<a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a> simulates a connection and can be used everywhere
where a <a class="link" href="InfXmlConnection.html" title="InfXmlConnection"><span class="type">InfXmlConnection</span></a> is expected. Use
<a class="link" href="InfSimulatedConnection.html#inf-simulated-connection-connect" title="inf_simulated_connection_connect ()"><code class="function">inf_simulated_connection_connect()</code></a> to connect two such connections so that
data sent through one is received by the other.
</p>
</div>
<div class="refsect1" title="Details">
<a name="InfSimulatedConnection.details"></a><h2>Details</h2>
<div class="refsect2" title="InfSimulatedConnection">
<a name="InfSimulatedConnection-struct"></a><h3>InfSimulatedConnection</h3>
<pre class="programlisting">typedef struct _InfSimulatedConnection InfSimulatedConnection;</pre>
<p>
<a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a> is an opaque data type. You should only access it
via the public API functions.
</p>
</div>
<hr>
<div class="refsect2" title="InfSimulatedConnectionClass">
<a name="InfSimulatedConnectionClass"></a><h3>InfSimulatedConnectionClass</h3>
<pre class="programlisting">typedef struct {
} InfSimulatedConnectionClass;
</pre>
<p>
This structure does not contain any public fields.
</p>
</div>
<hr>
<div class="refsect2" title="enum InfSimulatedConnectionMode">
<a name="InfSimulatedConnectionMode"></a><h3>enum InfSimulatedConnectionMode</h3>
<pre class="programlisting">typedef enum _InfSimulatedConnectionMode {
  INF_SIMULATED_CONNECTION_IMMEDIATE,
  INF_SIMULATED_CONNECTION_DELAYED
} InfSimulatedConnectionMode;
</pre>
<p>
The mode of a simulated connection defines when sent messages arrive at
the target connection.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="INF-SIMULATED-CONNECTION-IMMEDIATE:CAPS"></a><span class="term"><code class="literal">INF_SIMULATED_CONNECTION_IMMEDIATE</code></span></p></td>
<td>Messages are received directly by the
target site when calling <a class="link" href="InfXmlConnection.html#inf-xml-connection-send" title="inf_xml_connection_send ()"><code class="function">inf_xml_connection_send()</code></a>.
</td>
</tr>
<tr>
<td><p><a name="INF-SIMULATED-CONNECTION-DELAYED:CAPS"></a><span class="term"><code class="literal">INF_SIMULATED_CONNECTION_DELAYED</code></span></p></td>
<td>Messages are queued, and delivered to
the target site when <a class="link" href="InfSimulatedConnection.html#inf-simulated-connection-flush" title="inf_simulated_connection_flush ()"><code class="function">inf_simulated_connection_flush()</code></a> is called.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_simulated_connection_new ()">
<a name="inf-simulated-connection-new"></a><h3>inf_simulated_connection_new ()</h3>
<pre class="programlisting"><a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="returnvalue">InfSimulatedConnection</span></a> * inf_simulated_connection_new   (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Creates a new <a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new <a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_simulated_connection_connect ()">
<a name="inf-simulated-connection-connect"></a><h3>inf_simulated_connection_connect ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_simulated_connection_connect    (<em class="parameter"><code><a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a> *connection</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a> *to</code></em>);</pre>
<p>
Connects two simulated connections, so that data sent through one of them
is received by the other one. If one or both of the connections already
have another target, then the simulated connection between those is closed
first.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>A <a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>to</code></em> :</span></p></td>
<td>The target connection.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_simulated_connection_set_mode ()">
<a name="inf-simulated-connection-set-mode"></a><h3>inf_simulated_connection_set_mode ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_simulated_connection_set_mode   (<em class="parameter"><code><a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a> *connection</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfSimulatedConnection.html#InfSimulatedConnectionMode" title="enum InfSimulatedConnectionMode"><span class="type">InfSimulatedConnectionMode</span></a> mode</code></em>);</pre>
<p>
Sets the mode of the simulated connection.
</p>
<p>
In <a class="link" href="InfSimulatedConnection.html#INF-SIMULATED-CONNECTION-IMMEDIATE:CAPS"><code class="literal">INF_SIMULATED_CONNECTION_IMMEDIATE</code></a> mode, messages sent through the
connection are received by the target during the call to
<a class="link" href="InfXmlConnection.html#inf-xml-connection-send" title="inf_xml_connection_send ()"><code class="function">inf_xml_connection_send()</code></a>.
</p>
<p>
In <a class="link" href="InfSimulatedConnection.html#INF-SIMULATED-CONNECTION-DELAYED:CAPS"><code class="literal">INF_SIMULATED_CONNECTION_DELAYED</code></a> mode, messages sent are queued and
received by the target when <a class="link" href="InfSimulatedConnection.html#inf-simulated-connection-flush" title="inf_simulated_connection_flush ()"><code class="function">inf_simulated_connection_flush()</code></a> is called.
</p>
<p>
When changing the mode from <a class="link" href="InfSimulatedConnection.html#INF-SIMULATED-CONNECTION-DELAYED:CAPS"><code class="literal">INF_SIMULATED_CONNECTION_DELAYED</code></a> to
<a class="link" href="InfSimulatedConnection.html#INF-SIMULATED-CONNECTION-IMMEDIATE:CAPS"><code class="literal">INF_SIMULATED_CONNECTION_IMMEDIATE</code></a>, then the queue is flushed, too.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>A <a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>mode</code></em> :</span></p></td>
<td>The new mode to set.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_simulated_connection_flush ()">
<a name="inf-simulated-connection-flush"></a><h3>inf_simulated_connection_flush ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_simulated_connection_flush      (<em class="parameter"><code><a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a> *connection</code></em>);</pre>
<p>
When <em class="parameter"><code>connection</code></em>'s mode is <a class="link" href="InfSimulatedConnection.html#INF-SIMULATED-CONNECTION-DELAYED:CAPS"><code class="literal">INF_SIMULATED_CONNECTION_DELAYED</code></a>, then calling
this function makes the target connection receive all the queued messages.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
<td>A <a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="InfSimulatedConnection.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "mode" property'>
<a name="InfSimulatedConnection--mode"></a><h3>The <code class="literal">"mode"</code> property</h3>
<pre class="programlisting">  "mode"                     <a class="link" href="InfSimulatedConnection.html#InfSimulatedConnectionMode" title="enum InfSimulatedConnectionMode"><span class="type">InfSimulatedConnectionMode</span></a>  : Read / Write / Construct</pre>
<p>The mode of the simulated connection.</p>
<p>Default value: INF_SIMULATED_CONNECTION_IMMEDIATE</p>
</div>
<hr>
<div class="refsect2" title='The "target" property'>
<a name="InfSimulatedConnection--target"></a><h3>The <code class="literal">"target"</code> property</h3>
<pre class="programlisting">  "target"                   <a class="link" href="InfSimulatedConnection.html" title="InfSimulatedConnection"><span class="type">InfSimulatedConnection</span></a>*  : Read / Write</pre>
<p>The simulated connection receiving data sent through this connection.</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>